<template>
  <a-modal
    :visible="visible"
    title="审核"
    okText='保存'
    :width="700"
    @cancel="() => { $emit('cancel') }"
    @ok="() => { $emit('create') }"
  >
    <a-form :form="form">
      <a-row>
        <a-form-item
          label="审核状态"
          :labelCol="{span: 4,offset: 2}"
          :wrapperCol="{span: 16}"
        >
          <a-select v-decorator="[
            'statusCode',
            {
              rules: [{ required: true, message: '请选择审核状态!' }],
            }
          ]">
            <a-select-option v-for="i in status" :key="i.id" :value="i.id">{{ i.name }}</a-select-option>
          </a-select>
        </a-form-item>
      </a-row>
      <a-form-item label="审核备注" :labelCol="{span: 4,offset: 2}" :wrapperCol="{span: 16}">
        <a-input type="textarea" v-decorator="[
            'explain',
            {
              rules: [{ required: true, message: '请填写审核备注!' }],
            }
          ]" :autosize="{ minRows: 2, maxRows: 6 }"/>
      </a-form-item>
    </a-form>
  </a-modal>
</template>

<script>
export default {
  props: ['visible', 'editId'],
  data () {
    return {
      status: []
    }
  },
  beforeCreate () {
    this.$api.base.dictionaryData('TYPE0122').then(res => {
      this.status = res.data
    })
    this.form = this.$form.createForm(this)
  }
}
</script>

<style>

</style>
